/// <reference path="../_all.ts" />

module Application.Resources {
    export interface IUserClass extends ng.resource.IResourceClass {
    }

    export interface IUser extends ng.resource.IResource {
        user_id: number;
        login: string;
        password: string;
        group_id: number;
        email: string;
        lang: string;
        is_active: boolean;
        is_blocked: boolean;
        role: number;
        last_ip: string;
        last_connection: Date;
    }

    export class UserUtility {
        static fixBooleans(item: IUser) {
            item.is_active = Application.Utility.Booleans.parse(item.is_active, true);
            item.is_blocked = Application.Utility.Booleans.parse(item.is_blocked);
        }
    }
}